package com.sani.study2025.conctroller;

import com.sani.study2025.entity.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.ConversionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    private ConversionService conversionService;
    @GetMapping("/")
    public String hello() {
        UserEntity user = new UserEntity();
        user.setName("san");
        user.setAge(18);
        UserEntity convert = conversionService.convert(user, UserEntity.class);
        System.out.println();
        return convert.getName();
    }
}
